﻿using NUnit.Framework;
using RMH.DataAccess;
using RMH.Entities;
using RMH.Services;

namespace RMH.UnitTests.Services
{
    [TestFixture]
    public class CountyService_when_getting_a_county_by_id : base_automock_test
    {
        private County county = new County() { Id = 1 };
        private County returnedCounty = new County() { Id = 1 };
        private int countyId = 1;

        public override void establish_context()
        {
            Mock<ICountyRepository>()
                .Setup(s => s.GetByID(countyId))
                .Returns(returnedCounty);
        }

        public override void because()
        {
            returnedCounty = Create<CountyService>().Get(countyId);
        }

        [Test]
        public void returns_a_patient_from_the_respository()
        {
            returnedCounty.ShouldEqual(county);
        }
    }
}
